package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    /**
     * 根据用户id和参数(dishId / dishId + 口味 / setmeal_id)
     * @param shoppingCart
     * @return
     */
    ShoppingCart findShoppingCartByUserIdAndOptions(ShoppingCart shoppingCart);

    /**
     * 添加购物车
     * @param shoppingCart
     */
    void save(ShoppingCart shoppingCart);

    void updateNumberById(ShoppingCart dbShoppingCart);

    /**
     * 获取购物车数据
     * @param userId
     * @return
     */
    List<ShoppingCart> findByUserId(Long userId);

    void clean(Long userId);
}
